import React, { Component } from 'react'

import { connect } from "react-redux"

class shouji extends Component {
    state = {
        truephone: ""
    }
    componentDidMount() {
        let phone = this.props.user.data.phone
        this.setState({
            truephone: phone.substr(0, 3) + "****" + phone.substr(7)
        })
    }
    render() {
        return (
            <li>
                <p>手机号</p>
                <div>{this.state.truephone}</div>
            </li>
        )
    }
}

export default connect(
    state => ({
        user: state.user
    })
)(shouji)




